package o;

import java.io.IOException;
import java.lang.reflect.Array;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public final class auh<E> extends ato<Object> {
    public static final ats ˋ = new ats() {
        public <T> ato<T> ˎ(atb o_atb, auv<T> o_auv_T) {
            Type ˏ = o_auv_T.ˏ();
            if (!(ˏ instanceof GenericArrayType) && (!(ˏ instanceof Class) || !((Class) ˏ).isArray())) {
                return null;
            }
            ˏ = atp.ʽ(ˏ);
            return new auh(o_atb, o_atb.ˏ(auv.ˋ(ˏ)), atp.ˏ(ˏ));
        }
    };
    private final Class<E> ˎ;
    private final ato<E> ॱ;

    public auh(atb o_atb, ato<E> o_ato_E, Class<E> cls) {
        this.ॱ = new auo(o_atb, o_ato_E, cls);
        this.ˎ = cls;
    }

    public Object ˏ(auy o_auy) throws IOException {
        if (o_auy.ʻ() == auz.NULL) {
            o_auy.ॱॱ();
            return null;
        }
        List arrayList = new ArrayList();
        o_auy.ˊ();
        while (o_auy.ˋ()) {
            arrayList.add(this.ॱ.ˏ(o_auy));
        }
        o_auy.ˎ();
        int size = arrayList.size();
        Object newInstance = Array.newInstance(this.ˎ, size);
        for (int i = 0; i < size; i++) {
            Array.set(newInstance, i, arrayList.get(i));
        }
        return newInstance;
    }

    public void ˎ(aux o_aux, Object obj) throws IOException {
        if (obj == null) {
            o_aux.ᐝ();
            return;
        }
        o_aux.ˎ();
        int length = Array.getLength(obj);
        for (int i = 0; i < length; i++) {
            this.ॱ.ˎ(o_aux, Array.get(obj, i));
        }
        o_aux.ॱ();
    }
}
